import React from 'react'
// ===================================================================== Temp
import Table from '#cpt/temp/Table'
import SpecCode from '#tp/specCode'
// ===================================================================== global declare
const { $fn } = window
// ===================================================================== component
class Index extends React.Component{
	state = {
		data:[],
		pag: {},
		selectedKeys:[],
	}
	model = {}
	componentDidMount(){
		// setTimeout(() => {
		// 	this.props.status!==3 && this.props.onFetch()
		// })
	}
	
	fetch = () => {
		$fn.fetch.call(this,'spec-case-info/doubleList' )
	}
	clearSelect = () => {
		this.setState({selectedKeys:[]})
	}
	
	// 关联表单
	cols = [
		{ title: '申请单条码',	dataIndex: 'spec_code', 		...SpecCode(),	sorter:true },
		{ title: '送检单位', 	dataIndex: 'hosp_name', 		width: 200 },
		{ title: '受检人姓名',	dataIndex: 'patient_name', 		...$fn.table.name },
		{ title: '性别',		dataIndex: 'sex_name',			...$fn.table.sex },
		{ title: '年龄',		dataIndex: 'age', 				...$fn.table.age },
		{ title: '受检人电话', 	dataIndex: 'patient_phone', 	...$fn.table.phone },
		{ title: '证件类型', 	dataIndex: 'card_type_name', 	...$fn.table.card_type },
		{ title: '证件号', 		dataIndex: 'card_no', 			...$fn.table.idcard },
		{ title: '送检科室', 	dataIndex: 'department_name', 	width: 90 },
		{ title: '送检医生', 	dataIndex: 'doctor', 			width: 90 },
		{ title: '医生电话', 	dataIndex: 'doctor_phone', 		...$fn.table.phone },
		{ title: '采集时间', 	dataIndex: 'coll_time', 		...$fn.table.time },
	]

	render(){
		return (
			<>
				{/* 子表格 */}
				{Table.call(this,{ type: 1, sort: true,
					onRow: ( {spec_code} )=>{
						this.props.clearSelect()
						this.props.onRow(spec_code)
					},
				})}
			</>
		)
	}
}

export default Index
// 双录入调整，分别显示第一次录入，第二次录入 2022/6/17  --马婷